package edu.sctu.zhengsenwen.month201506.day20150615.txt;

import java.io.*;

/**
 * Created by user15 on 2015/6/15.
 */
public class TxtFileReadOrWrite {

    public static void main(String[] args) throws IOException {


        File intputFile = new File("C:\\C20\\demo1.txt");
        File outputFile = new File("C:\\C20\\demo2.txt");


        FileReader in = new FileReader(intputFile);
        FileWriter out = new FileWriter(outputFile);

        int count;

        //判断是否为空
        while ((count = in.read()) != -1) {

            out.write(count);
        }


        in.close();

        out.close();

        System.out.println("成功创建文件 demo2.txt");


    }

}
